package org.fas.sqlData
{
	public class SqlData
	{
		public var id:int=0;
		public function SqlData(_v:Object=null)
		{
			if(_v!=null){
			}else{
				_v = this.nullObject();
			}
			this.bind(_v);
		}
		public function bind(_v:Object):void{
			for(var p:String in _v){
				if(p in this){
					this[p] = _v[p];
				}else{
//					trace('Excess Property',p,_v[p]);
				}
			}
		}
		public function random():void{
			this.bind(this.newRandomObject);	
		}
		private function nullObject():Object{
			var _v:Object = new Object();
			_v.id = 0;
			return _v;
		}
		public function get newRandomObject():Object{
			var _v:Object = new Object();
			_v.id = 0;
			return _v;
		}
		public function toJsonObject(_args:Array=null):Object{
			if(_args==null){
				_args = new Array();
			}
			_args.push('id');
			return FuObject.copyObject(this,_args);
		}
	}
}